<template>
	<view>
		<view class="l1" v-for="item in list" @click="todetail(item.id)">
			<view class="l3">
				<image :src="'http://124.93.196.45:10001'+item.imgUrl"></image>
			</view>
			<view class="l2">
				<text>{{item.name}}</text>
				<text>{{item.address}}</text>
				<text>营业时间：{{item.businessHours}}</text>
				<text>营业状态：营业</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[]
			}
		},
		onLoad() {
			this.getlist()
		},
		methods: {
			getlist(){
				this.api.get('/prod-api/api/digital-library/library/list').then(res=>{
					this.list=res.data.rows
					console.log(res.data)
				})
			},
			todetail(id){
				uni.navigateTo({
					url:'/pages/serve/libary/librarydetail/librarydetail?id='+id
				})
			}
		}
	}
</script>

<style lang="scss">
.l1{
	display: flex;
	margin-bottom: 20px;
	border-bottom: 2px solid sandybrown;
	.l3{
		width: 45%;
		image{
			width: 150px;
			height: 150px;
		}
	}
	.l2{
		margin-left: 10px;
		font-size: 18px;
		display: flex;
		flex-direction: column;
		line-height: 30px;
	}
}
</style>
